<?php
/* [$WindsForce] (C)Hunzhiwange.COM Since 2014.07.14.
   家居公司装修日记列表($$)*/

!defined('Q_PATH') && exit;

class Diary_C_Controller extends InitController{

	public function index(){
		$arrJiajucompany=$this->_oParent->_arrJiajucompany;
		
		Core_Extend::getSeo($this,array(
			'title'=>"{$arrJiajucompany['jiajucompany_fullname']}装修日记 - {$arrJiajucompany['jiajucompany_fullname']}网友日记",
			'keywords'=>"{$arrJiajucompany['jiajucompany_fullname']}装修日记,{$arrJiajucompany['jiajucompany_fullname']}网友日记",
			'description'=>"{$arrJiajucompany['jiajucompany_fullname']}装修日记-{$arrJiajucompany['jiajucompany_fullname']}网友日记",
		));

		// 装修日记列表
		$arrWhere=array();
		$arrWhere['jiajudiary_status']=1;
		$arrWhere['jiajucompany_id']=$arrJiajucompany['jiajucompany_id'];

		$nTotal=Model::F_('jiajudiary')->where($arrWhere)->getCounts();
		$oPage=Page::RUN($nTotal,25,Jiaju_Extend::getDiarypageUrl($arrJiajucompany,false));
		$arrDiarys=Model::F_('jiajudiary')
			->setColumns('jiajudiary_link,jiajudiary_title,jiajudiary_user,create_dateline')
			->where($arrWhere)
			->order('jiajudiary_id DESC')
			->limit($oPage->S(),$oPage->N())
			->getAll();

		$this->assign('arrDiarys',$arrDiarys);
		$this->assign('nTotalDiary',$nTotal);
		$this->assign('sPageNavbar',$oPage->P(array('id'=>'pagination','style'=>'li','current'=>'active')));
		$this->display(Jiaju_Extend::getTemplate($arrJiajucompany,'diary'));
	}

}
